
package com.insigma.business.qrcode.soldier.service.impl;

import com.insigma.business.qrcode.common.service.SequenceGenerator;
import com.insigma.business.qrcode.soldier.dao.SoldierHouseInfoDao;
import com.insigma.business.qrcode.soldier.dto.SequenceNameConstant;
import com.insigma.business.qrcode.soldier.entity.SoldierHouseInfoDO;
import com.insigma.business.qrcode.soldier.request.SoldierHouseInfoBSearcher;
import com.insigma.business.qrcode.soldier.service.SoldierHouseInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service("soldierHouseInfoService")
public class SoldierHouseInfoServiceImpl implements SoldierHouseInfoService {

    @Autowired(required = false)
    private SoldierHouseInfoDao soldierHouseInfoDao;
    @Autowired(required = false)
    private SequenceGenerator sequenceGenerator;

    
    @Override
    public List<SoldierHouseInfoDO> search(final SoldierHouseInfoBSearcher soldierHouseInfoBSearcher) {
        return soldierHouseInfoDao.search(soldierHouseInfoBSearcher);
    }
   
    @Override
    public SoldierHouseInfoDO get(final String id){
        return soldierHouseInfoDao.get(id);
    }

    
    @Override
    public Integer insert(final SoldierHouseInfoDO soldierHouseInfoDO){
        soldierHouseInfoDO.setId(sequenceGenerator.genKey(SequenceNameConstant.SOLDIER_HOUSE_INFO_ID));
        return soldierHouseInfoDao.insert(soldierHouseInfoDO);
    }

    
    @Override
    public Integer update(final SoldierHouseInfoDO soldierHouseInfoDO){
        return soldierHouseInfoDao.update(soldierHouseInfoDO);
    }

    
    @Override
    public Integer delete(final String id, final String modifierType, final String modifierId){
        return soldierHouseInfoDao.delete(id,modifierType,modifierId);
    }

}
